package com.zly.entity.enums;

public enum SegmentType {

    CHOOSE_SEGMENT("choose_segment"),               //在多个block中根据条件选择某个block
    SINGLE_BLOCK_SEGMENT("single_block_segment"),   //仅单个block
    IMPLICIT_SINGLE_BLOCK_SEGMENT(null),            //隐式单个block

    ;

    private final String strValue;

    private SegmentType(String strValue) {
        this.strValue = strValue;
    }

    //从字符串值转为枚举值
    public static SegmentType from(String strValue) {
        for(SegmentType segmentType : values()) {
            if(segmentType.strValue.equals(strValue)) {
                return segmentType;
            }
        }
        return null;
    }

    public String getStrValue() {
        return strValue;
    }


}
